package com.oreilly.ez.fileserver.base;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import java.nio.file.Path;
import java.nio.file.Paths;


@Component
public class AfterBoot implements ApplicationRunner {

    @Autowired
    private YmlConfig ymlConfig;
    @Override
    public void run(ApplicationArguments args) throws Exception {

        Path path = Paths.get(".").toAbsolutePath().normalize();
        System.out.println("path =" + path);

        System.out.println("server port = " + ymlConfig.getPort());
    }
}
